﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.Composition;
using System.ComponentModel.Composition.Primitives;
using System.ComponentModel.Composition.Hosting;
using CompositionPlugin.Service;

namespace CompositionPlugin
{
    public static class Utility
    {
        public static SystemRuntime CreateRuntimeWithServiceExtension(ExportProvider exportProvider)
        {
            return new SystemRuntime(exportProvider, new Tuple<Type, IRuntimeService>[]{
                // default server extesion
                new Tuple<Type, IRuntimeService>(typeof(IDataTemplateManager), new DataTemplateManager()),
                new Tuple<Type, IRuntimeService>(typeof(IUIDispatcher), new UIDispatcher()),
                new Tuple<Type, IRuntimeService>(typeof(IUIComposition), new UIComposition())
            });
        }
    }
}
